enum NUM {
    //% block="1"
    0,
    //% block="2"
    1,
    //% block="3"
    2,
    //% block="4"
    3,
    //% block="5"
    4,
    //% block="6"
    5,
    //% block="7"
    6,
    //% block="8"
    7 
}
enum BTN {
    //% block="上"
    0,
    //% block="下"
    1,
    //% block="左"
    2,
    //% block="右"
    3,
    //% block="F2"
    4,
    //% block="F4"
    5,
    //% block="F6"
    6
}


//% color="#AA278D" iconWidth=50 iconHeight=40
namespace handuan {

    //% block="遥控器通道[PART] - [BUTTON]红外值" blockType="reporter"
    //% PART.shadow="dropdown" PART.options="NUM"  PART.defl="NUM.0"
    //% BUTTON.shadow="dropdown" BUTTON.options="BTN"  BUTTON.defl="BTN.0"
    export function send(parameter: any, block: any) {
        let part = parameter.PART.code;
        let button = parameter.BUTTON.code;
        var REV_CODE=[["370326124","-401798257","722094923","501778864","87667472","1457459944","1189162337"],
                 ["-2060198430","1954985285","781883471","835149340","2113464299","653646598","855791861"],
                 ["-129486175","30903566","-1148828784","-1535736237","257421278","1277065657","-1068289858"],
                 ["-79153320","47681187","-1199161639","-1552513858","274198899","1327398512","-1051512237"],
                 ["-79153317","47681184","-1199161638","-1552513859","274198896","1327398515","-1051512240"],
                 ["-750405174","718933041","1216271043","327020756","945450753","656146658","-380260383"],
                 ["-1811806114","1780333981","1618831895","-1680353374","402038415","1199558996","-923672721"],
                 ["397148545","-1235920999","-1552513858","-112027819","274198899","274198899","1680019374"]];
        Generator.addCode(`"${REV_CODE[part][button]}"`);
    }

}
